package com.sysmanage.etl.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @description 目标数据源
 * @author ynshun
 * 
 */
@Entity
@Table(name = "ETL_DATASOURCE")
public class ETL_DataSource implements Serializable {
	private static final long serialVersionUID = 8293246048605797773L;

	private Integer dataSource_id;
	private String dataSource_name;
	private String dataSource_ip;
	private String dataSource_port;
	private Integer dataSource_dialect;
	private String dataSource_dbname;
	private String dataSource_username;
	private String dataSource_password;
	private Set<ETL_Table> tables = new HashSet<ETL_Table>();

	@Id
	@GeneratedValue
	@Column(name = "DATASOURCE_ID")
	public Integer getDataSource_id() {
		return dataSource_id;
	}

	public void setDataSource_id(Integer dataSource_id) {
		this.dataSource_id = dataSource_id;
	}

	@Column(name = "DATASOURCE_NAME")
	public String getDataSource_name() {
		return dataSource_name;
	}

	public void setDataSource_name(String dataSource_name) {
		this.dataSource_name = dataSource_name;
	}

	@Column(name = "DATASOURCE_IP")
	public String getDataSource_ip() {
		return dataSource_ip;
	}

	public void setDataSource_ip(String dataSource_ip) {
		this.dataSource_ip = dataSource_ip;
	}

	@Column(name = "DATASOURCE_PORT")
	public String getDataSource_port() {
		return dataSource_port;
	}

	public void setDataSource_port(String dataSource_port) {
		this.dataSource_port = dataSource_port;
	}

	@Column(name = "DATASOURCE_DIALECT")
	public Integer getDataSource_dialect() {
		return dataSource_dialect;
	}

	public void setDataSource_dialect(Integer dataSource_dialect) {
		this.dataSource_dialect = dataSource_dialect;
	}

	@Column(name = "DATASOURCE_USERNAME")
	public String getDataSource_username() {
		return dataSource_username;
	}

	public void setDataSource_username(String dataSource_username) {
		this.dataSource_username = dataSource_username;
	}

	@Column(name = "DATASOURCE_PASSWORD")
	public String getDataSource_password() {
		return dataSource_password;
	}

	public void setDataSource_password(String dataSource_password) {
		this.dataSource_password = dataSource_password;
	}

	@Column(name = "DATASOURCE_DBNAME")
	public String getDataSource_dbname() {
		return dataSource_dbname;
	}

	public void setDataSource_dbname(String dataSource_dbname) {
		this.dataSource_dbname = dataSource_dbname;
	}

	@OneToMany(mappedBy = "dataSource", fetch = FetchType.EAGER)
	public Set<ETL_Table> getTables() {
		return tables;
	}

	public void setTables(Set<ETL_Table> tables) {
		this.tables = tables;
	}

}
